<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8" %>
    <%@ taglib uri="/struts-tags"  prefix="s"%>
    <%request.setCharacterEncoding("utf-8");%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="utf-8">
<title>-.-</title>
<link rel="stylesheet" href="../../styles/backstage.css">
<link rel="stylesheet" href="../../scripts/jquery-ui/css/ui-lightness/jquery-ui-1.10.4.custom.css" />
<script src="../../scripts/jquery-ui/js/jquery-1.10.2.js"></script>
<script src="../../scripts/jquery-ui/js/jquery-ui-1.10.4.custom.js"></script>
<script src="../../scripts/jquery-ui/js/jquery-ui-1.10.4.custom.min.js"></script>
</head>

<body>
<div class="details">
                    <div class="details_operation clearfix">
                        <div class="bui_select">
                            <input type="button" value="添&nbsp;&nbsp;加" class="add"  onclick="addUser()">
                        </div>
                        
                         <div class="text">
                                <span>搜索</span>
                                <input type="text" value="" class="search"  id="search" onkeypress="search()" >
                            </div>
                            
                    </div>
                    <!--表格-->
                    <table class="table" cellspacing="0" cellpadding="0">
                        <thead>
                            <tr>
                                <th width="15%">编号</th>
                                <th width="20%">用户名称</th>
                                <th width="20%">用户邮箱</th>
                                <th width="20%">是否激活</th>
                                <th width="20%">用户类型</th>
                                <th>操作</th>
                            </tr>
                        </thead>
                        <tbody>
                          <s:iterator value="#session.pageBean.list" >
                            <tr>
                                <td><input type="checkbox" class="check"  value="objId" id="objId"><s:property value="userId"/></td>
                                <td><s:property value="userName"/></td>
                                <td><s:property value="email"/></td>
                                <td><s:property value="password"/></td>
                                <td><s:property value="theRole.roleName"/></td>
                                <td align="center">
                                	<input type="button" value="修改" class="btn" onclick="editUser(<s:property value="objId"/>)">
                                	<input type="button" value="删除" class="btn"  onclick="delUser(<s:property value="objId"/>)">
                                	</td>
                            </tr>
                            </s:iterator>
                        </tbody>
                        
                    </table>
                 <table border="0" cellspacing="0" cellpadding="0" width="900px">
                        	<tr>  
				            <td align="right" colspan="5">  
				            <span>  
				                 第<s:property value="#session.pageBean.pageIndex" />/<s:property value="#session.pageBean.pageSize" />页  
				            </span>  
				                 
				            <span>  
				                总记录数：<s:property value="#session.pageBean.count" />    
				                每页显示:<s:property value="#session.pageBean.pageCount" /></span>     
				            <span>  
				               <s:if test="#session.pageBean.pageIndex != 1">  
				                    <a href="User_searchingUser.action?pageIndex=1">[首页]</a>    
				                    <a href="User_searchingUser.action?pageIndex=<s:property value="#session.pageBean.pageIndex-1"/>">[上一页]</a>    
				               </s:if>   
				               <s:if test="#session.pageBean.pageIndex != #session.pageBean.pageSize">  
				                    <a href="User_searchingUser.action?pageIndex=<s:property value="#session.pageBean.pageIndex+1"/>">[下一页]</a>    
				                    <a href="User_searchingUser.action?pageIndex=<s:property value="#session.pageBean.pageSize"/>">[尾页]</a>    
				               </s:if>   
				            </span>  
				            </td>  
				        </tr>  
                        </table>
                        
                </div>
</body>
<script type="text/javascript">

	function addUser(){
		window.location="User_showAddUser.action";	
	}
	function editUser(id){
			window.location="User_findEditUser.action?user.objId="+id;
	}
	function search(){
		if(event.keyCode==13){
			var val=document.getElementById("search").value;
			window.location="User_searchingUser.action?keyword="+encodeURI(encodeURI(val));
		}
	}
	function delUser(id){
			if(window.confirm("您确定要删除吗？删除之后不可以恢复哦！！！"+id)){
				window.location="User_deleteUser.action?user.objId="+id;
			}
	}
</script>
</html>